{% if not thr.closed and not page_next%}
    {% if user.is_authenticated %}
    <!-- div style="border: 1px solid #ccc; padding: 5px; background: #efe" -->
    <form id="add_post_div" action="" method="POST">
        <script type="text/javascript" src="/media/js/yui/event-min.js"></script>
        <script type="text/javascript" src="/media/js/yui/autocomplete-min.js"></script>

        <p><span style="float:right;"><b>Pretty-print guide</b></span> <b>Got something to say?</b></p>
        
        <div style="display:none; background:#dddddd; border: 1px solid #333333; padding: 3px;">
            <p><b>**bold**</b> <i>__italic__</i></p>
            <p>An [example](http://url.com/ "Title")</p>
        </div>

        <br />

        <p>{{ postform.post }} {{ postform.post.errors }}</p>
        <p id="autocomplete_p">
            <!-- span style="float:right;"><b>I need more space!</b></span -->
            <a href="#add_post_div" onClick="toggle('autocomplete_input', 'block'); toggle('autocomplete_p', 'inline');">set private recipients (optional)</a>
        </p>
        <div id="autocomplete_input" style="display:none">
            <p>{{ postform.private }}{{ postform.private.errors }}</p>
            <div id="autocomplete_div"></div>
            <script type="text/javascript">
                dataSource = new YAHOO.widget.DS_XHR("/snapboard/rpc/user_lookup/", ["ResultSet.Result","name","id"]);
                autoComp = new YAHOO.widget.AutoComplete("id_private","autocomplete_div",dataSource);
                autoComp.delimChar = ","; 
                autoComp.typeAhead = true;
                autoComp.highlightClassName = "highlight";
            </script>
        </div>

        <input type="submit" value="Post">
    </form>
    {% else %}
    <p>You need to <a href="/snapboard/signin/?next={{ request.path|urlencode }}#add_post_div">sign in</a> to post messages.</p>
    {% endif %}
{% endif %}
{% if thr.closed %}
    <p>This discussion has been closed by the staff.  You can no longer add posts.</p>
{% endif %}
